package scm;

public class EmailValidator
{
    private String email="";

    public EmailValidator(String email)
    {
        this.email=email;
    }

    public boolean check()
    {
        if (email == null)
            return false;

        if (email.equals(""))
            return false;

        int fpos = email.indexOf("@");
        int spos = email.indexOf("@",fpos+1);

        if (spos >= 0)
            return false;

        int fpos1 = email.indexOf(".");
        int spos1 = email.indexOf(".",fpos1+1);

        if (spos >= 0)
            return false;

        return true;
    }
}